package com.significantfiles.snapshot.engine.tx;

import java.io.Serializable;

import com.significantfiles.snapshot.engine.rt.Model;
import com.significantfiles.snapshot.engine.tx.x.TransactionInitializationException;

public abstract class Transaction<T extends Serializable>
		implements Serializable {

	private static final long serialVersionUID = 1L;

	private final T input;

	public Transaction(final T input) throws TransactionInitializationException {
		if( input == null )
			throw new TransactionInitializationException( "Input is NULL." );
		
		this.input = input;
	}
	
	
	public abstract void execute(final Model rootObject)
			throws TransactionException;

	public T getInput() {
		return this.input;
	}
	
	public abstract long getVersion();
}
